global root "/Volumes/Workgroup/Lab/Lab-heimb/Montenovo/Volunteering Paper/Data"
global results "$root/07_results/RR/main"
global dictionaries "$root/Dictionaries"

cd "$dictionaries"
capture log close
log using regression_log_income, replace

cd "$root"
use appended_analytic_010305111719, clear 

foreach var of varlist sex black native_amer asian other hispanic {
bysort unique_id_crossys: egen sd_`var'=sd(`var')
tab sd_`var'
drop sd_`var'
}

gen log_post_tax_income=log(post_tax_income)


*extensive, year state individual fe
eststo extensive_margin_fe: reghdfe whether_volunteer_person  taxprice log_post_tax_income hourly_wage_aftertax full_time age sex  married black native_amer asian other hispanic HS some_college college_grad college_plus children religion rural, absorb(year state unique_id_crossys) vce(cluster state)
gen sample=e(sample)
bysort unique_id_crossys: gen nvals=_n==1
count if nvals==1 & sample==1
drop sample nvals

drop if year==2010
drop if hours_volunteer_person==0

*intensive, year state individual fe
eststo intensive_margin_fe: reghdfe hours_volunteer_person taxprice log_post_tax_income hourly_wage_aftertax full_time age sex  married black native_amer asian other hispanic HS some_college college_grad college_plus children religion rural, absorb(year state unique_id_crossys) vce(cluster state)
gen sample=e(sample)
bysort unique_id_crossys: gen nvals=_n==1
count if nvals==1 & sample==1
drop sample nvals

//////////////////////////////////////////////////////////////////////////
	 cd "$dictionaries"
log close	 


	 
	